using UnityEngine;
using UnityEngine.Events;

namespace LS.SimpleInput
{
    public class SimpleInputUnityEvent : MonoBehaviour
    {
        public UnityEvent<Gesture> OnAnyGestrue = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnAnyGestrueCancle = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnInput = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnInputStart = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnInputEnd = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnInputCancle = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnSimpleTap = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnDoubleTap = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnLongTapStart = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnLongTap = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnLongTapEnd = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnLongTapCancle = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnSwipeStart = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnSwipe = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnSwipeEnd = new UnityEvent<Gesture>();
        public UnityEvent<Gesture> OnSwipeCancle = new UnityEvent<Gesture>();

        private void Awake()
        {
            SimpleInput.OnAnyGestrue += OnAnyGestrueEvent;
            SimpleInput.OnAnyGestrueCancle += OnAnyGestrueCancleEvent;
            SimpleInput.OnInput += OnInputEvent;
            SimpleInput.OnInputStart += OnInputStartEvent;
            SimpleInput.OnInputEnd += OnInputEndEvent;
            SimpleInput.OnInputCancle += OnInputCancleEvent;
            SimpleInput.OnSimpleTap += OnSimpleTapEvent;
            SimpleInput.OnDoubleTap += OnDoubleTapEvent;
            SimpleInput.OnLongTapStart += OnLongTapStartEvent;
            SimpleInput.OnLongTap += OnLongTapEvent;
            SimpleInput.OnLongTapEnd += OnLongTapEndEvent;
            SimpleInput.OnLongTapCancle += OnLongTapCancleEvent;
            SimpleInput.OnSwipeStart += OnSwipeStartEvent;
            SimpleInput.OnSwipe += OnSwipeEvent;
            SimpleInput.OnSwipeEnd += OnSwipeEndEvent;
            SimpleInput.OnSwipeCancle += OnSwipeCancleEvent;

        }

        private void OnAnyGestrueEvent(Gesture gesture)
        {
            OnAnyGestrue?.Invoke(gesture);
        }

        private void OnAnyGestrueCancleEvent(Gesture gesture)
        {
            OnAnyGestrueCancle?.Invoke(gesture);
        }

        private void OnInputEvent(Gesture gesture)
        {
            OnInput?.Invoke(gesture);
        }

        private void OnInputStartEvent(Gesture gesture)
        {
            OnInputStart?.Invoke(gesture);
        }

        private void OnInputEndEvent(Gesture gesture)
        {
            OnInputEnd?.Invoke(gesture);
        }

        private void OnInputCancleEvent(Gesture gesture)
        {
            OnInputCancle?.Invoke(gesture);
        }

        private void OnSimpleTapEvent(Gesture gesture)
        {
            OnSimpleTap?.Invoke(gesture);
        }

        private void OnDoubleTapEvent(Gesture gesture)
        {
            OnDoubleTap?.Invoke(gesture);
        }

        private void OnLongTapStartEvent(Gesture gesture)
        {
            OnLongTapStart?.Invoke(gesture);
        }

        private void OnLongTapEvent(Gesture gesture)
        {
            OnLongTap?.Invoke(gesture);
        }

        private void OnLongTapEndEvent(Gesture gesture)
        {
            OnLongTapEnd?.Invoke(gesture);
        }

        private void OnLongTapCancleEvent(Gesture gesture)
        {
            OnLongTapCancle?.Invoke(gesture);
        }

        private void OnSwipeStartEvent(Gesture gesture)
        {
            OnSwipeStart?.Invoke(gesture);
        }

        private void OnSwipeEvent(Gesture gesture)
        {
            OnSwipe?.Invoke(gesture);
        }

        private void OnSwipeEndEvent(Gesture gesture)
        {
            OnSwipeEnd?.Invoke(gesture);
        }

        private void OnSwipeCancleEvent(Gesture gesture)
        {
            OnSwipeCancle?.Invoke(gesture);
        }
    }
}
